<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>无一合集</title>
    <style>
        .title{
            letter-spacing:1px!important;
            opacity: 0.9!important;
            line-height:40px!important;
        }
        .pay-ok{
            z-index:99;
        }
        #code{
            background-color:#fff;
            padding:15px;
            border-radius:5px;
        }
        .code-main{
            text-align:center;
            position:absolute;
            top:50%;
            left:50%;
            transform:translate(-50%,-50%);
            padding:15px;
            width:300px;
            height:auto;
        }
        .exit-btn{
            margin-top:20px;
            color: #ccc;
            display:block;
            margin:0  auto;
            font-size:24!important;
        }
    </style>
    <link rel="stylesheet" href="/fanli/style.min.css?111">
</head>
<body>
<div class="user">
    <div class="user-head">
            <span class="er">
                <i  class="iconfont icon-erweima"></i>
                使用优惠价
            </span>
        <div class="user-head-img" style="background-image: url({{user.avatar}})"></div>
        <span class="user-name">{{user.nickname}}</span>
    </div>

    <div class="code pay-ok" style="display:none;">
        <div class="code-main">
            <canvas id="code" style="text-align:center"></canvas>
            <i class="exit-btn iconfont icon-55 "></i>
        </div>
    </div>
   
    <ul class="user-info">
        <li>
            <i  class="iconfont icon-youhuiquan"></i>
            <p>
                <span class="title float-left">您已获得：</span>
                <span class="msg float-left">{{user.buy_num}}张优惠券</span>
            </p>
        </li>
        <li>
            <i  class="iconfont icon-shijian"></i>
            <p>
                <span class="title float-left">
                    获得延长时间：
                </span>
                <span class="msg float-right">{{user.award}}天</span>
            </p>
        </li>
        <li>
            <i  class="iconfont icon-dingdandaifukuan"></i>
            <p>
                <span class="title float-left">
                    成交量：
                </span>
                <span class="msg float-right">{{user.trade_num}}单</span>
            </p>
        </li>
        <li>
            <i  class="iconfont icon-liulanliang"></i>
            <p>
                <span class="title float-left">
                    浏览量：
                </span>
                <span class="msg float-right">{{user.views}}次</span>
            </p>
        </li>
    </ul>
</div>
</body>
<script src="/fanli/app.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script src="/fanli/jquey.js"></script>
<script src="/fanli/JsBarcode.all.js"></script>
<script>

    $(".er").click(function(){
        $(".code").toggle();
        JsBarcode("#code",'{{user.id}}',{
            displayValue:false
        })
    });

    $('.exit-btn').on('click',function(){
        $(".code").toggle();
    })

    wx.config({
        debug: false,
        appId: '{{wxjs_appid}}',
        timestamp: '{{wxjs_timestamp}}',
        nonceStr: '{{wxjs_noncestr}}',
        signature: '{{wxjs_signature}}',
        jsApiList: [
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'onMenuShareQZone'
        ]
    });
    wx.ready(function () {
        wx.error(function (res) {
            console.log(res);
        });
        //朋友圈
        wx.onMenuShareTimeline({
            title: "{{campinfo.shareCircle}}", // 分享标题
            link:"{{host}}/weixin/fanli/index?st={{token}}", // 分享链接
            imgUrl: "{{campinfo.shareImage}}", // 分享图标
            success: function () {
                // 用户确认分享后执行的回调函数

            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });

        //分享给朋友
        wx.onMenuShareAppMessage({
            title: "{{campinfo.shareTitle}}", // 分享标题
            desc: '{{campinfo.shareFriend}}', // 分享描述
            link:"{{host}}/weixin/fanli/index?st={{token}}", // 分享链接
            imgUrl: "{{campinfo.shareImage}}", // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                // 用户确认分享后执行的回调函数
            },
            cancel: function () {
                // 用户取消分享后执行的回调函数
            }
        });
    });
</script>
</html>